<script type="text/javascript">
$(function () {
	//var index = 1;
	var str = "";
	var flag = true;
    $("#tab").html("");
	$.get(
		"hotel/room-info.do",
		function(data){
			$.each(data, function (i, item) {
                str+="<tr>";
                str+="<td >"+item.roomId+"</td>";
                str+="<td >"+item.roomNum+"</td>";
                str+="<td >"+item.roomMarketPrice+"</td>";
                str+="<td >"+item.roomPlatformPrice+"</td>";
                str+="<td >"+item.roomImgs+"</td>";
                str+="<td >"+item.roomTypeName+"</td>";
                str+="<td ><a href='hotel/room-Update.html?roomId="+item.roomId+"'class='btn btn-success btn-xs'>查看</a></td>";
                str+="</tr>";
                console.info(i);
                if (i==4) {
                    console.info(i+"ss");
                	flag = false;
				}
            });
			if (flag) {
				$("#plus").append("<h3><a class='btn btn-success' href='hotel/room-add.html'>添加</a></h3>");
			}
            $("#tab").append(str);
		},"json"
	);
});	
	
</script>

<form>
	<table class="table table-bordered text-center" >
      <thead>
      	<tr style="font-weight:bold">
          <td>房间编号</th>
          <td>房间剩余数量</th>
          <td>市场价格</th>
          <td>平台价格</th>
          <td>房间图片</th>
          <td>房间名称</th>
          <td>操作</th>
        </tr>
      </thead>
      <tbody id="tab">
        
      </tbody>
    </table>
    <div id="plus"></div>
    <div class="text-center">
	    <ul class="pagination pull-right">
        	<li data-page="1">
        		<a href="javascript:void(0);" aria-label="Previous">
        			<spanaria-hidden="true">«</span>
        		</a>
        	</li>
			<li class="javascript:void(0);">
				<a href="javascript:void(0);">1</a>
			</li>
			<li>
				<a href="javascript:void(0);" aria-label="Next">
					<span aria-hidden="true">»</span>
				</a>
			</li>
	     </ul>
	</div>
</form>
<!-- Large modal -->
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
	     <div class="panel panel-primary">
	      <div class="panel-heading">
	        <h3 class="panel-title">订单管理修改</h3>
	      </div>
	      <div class="panel-body">
			<div class="input-group">
			  <span class="input-group-addon" id="sizing-addon2">地址</span>
			  <input type="text" class="form-control" placeholder="Username" aria-describedby="sizing-addon2">
			  <span class="input-group-btn">
        		<button class="btn btn-default" type="button">修改</button>
      		  </span>
			</div>
	      </div>
	    </div>
    </div>
  </div>
</div>